// pages/identify/information/index.js

const app = getApp()
const db = wx.cloud.database()
const _ = db.command
Page({

    /**
     * 页面的初始数据
     */
    data: {
        bxdate:[
            {from:"2020.1.3",start:"2020.1.4",to:"2021.1.3"},
            {from:"2020.2.3",start:"2020.2.4",to:"2021.2.3"},
            {from:"2020.3.3",start:"2020.3.4",to:"2021.3.3"},
            {from:"2020.4.3",start:"2020.4.4",to:"2021.4.3"},
            {from:"2020.5.3",start:"2020.5.4",to:"2021.5.3"},
            {from:"2020.6.3",start:"2020.6.4",to:"2021.6.3"},
            {from:"2020.7.3",start:"2020.7.4",to:"2021.7.3"},
            {from:"2020.8.3",start:"2020.8.4",to:"2021.8.3"},
            {from:"2020.9.3",start:"2020.9.4",to:"2021.9.3"},
            {from:"2020.10.3",start:"2020.10.4",to:"2021.10.3"},
            {from:"2020.11.3",start:"2020.11.4",to:"2021.11.3"},
            {from:"2020.12.3",start:"2020.12.4",to:"2021.12.3"},
            {from:"2020.1.1",start:"2020.1.2",to:"2021.1.1"},
            {from:"2020.2.1",start:"2020.2.2",to:"2021.2.1"},
            {from:"2020.3.1",start:"2020.3.2",to:"2021.3.1"},
            {from:"2020.4.1",start:"2020.4.2",to:"2021.4.1"},
            {from:"2020.5.1",start:"2020.5.2",to:"2021.5.1"},
            {from:"2020.6.1",start:"2020.6.2",to:"2021.6.1"},
            {from:"2020.7.1",start:"2020.7.2",to:"2021.7.1"},
            {from:"2020.8.1",start:"2020.8.2",to:"2021.8.1"},
            {from:"2020.9.1",start:"2020.9.2",to:"2021.9.1"},
            {from:"2020.10.1",start:"2020.10.2",to:"2021.10.1"},
            {from:"2020.11.1",start:"2020.11.2",to:"2021.11.1"},
            {from:"2020.12.1",start:"2020.12.2",to:"2021.12.1"},
            {from:"2022.1.3",start:"2022.1.4",to:"2023.1.3"},
            {from:"2022.2.3",start:"2022.2.4",to:"2023.2.3"},
            {from:"2022.3.3",start:"2022.3.4",to:"2023.3.3"},
            {from:"2022.4.3",start:"2022.4.4",to:"2023.4.3"},
            {from:"2022.5.3",start:"2022.5.4",to:"2023.5.3"},
            {from:"2022.6.3",start:"2022.6.4",to:"2023.6.3"},
            {from:"2022.7.3",start:"2022.7.4",to:"2023.7.3"},
            {from:"2022.8.3",start:"2022.8.4",to:"2023.8.3"},
            {from:"2022.9.3",start:"2022.9.4",to:"2023.9.3"},
            {from:"2022.10.3",start:"2022.10.4",to:"2023.10.3"},
            {from:"2022.11.3",start:"2022.11.4",to:"2023.11.3"},
            {from:"2022.12.3",start:"2022.12.4",to:"2023.12.3"},
            {from:"2022.1.6",start:"2022.1.7",to:"2023.1.6"},
            {from:"2022.2.6",start:"2022.2.7",to:"2023.2.6"},
            {from:"2022.3.6",start:"2022.3.7",to:"2023.3.6"},
            {from:"2022.4.6",start:"2022.4.7",to:"2023.4.6"},
            {from:"2022.5.6",start:"2022.5.7",to:"2023.5.6"},
            {from:"2022.6.6",start:"2022.6.7",to:"2023.6.6"},
            {from:"2022.7.6",start:"2022.7.7",to:"2023.7.6"},
            {from:"2022.8.6",start:"2022.8.7",to:"2023.8.6"},
            {from:"2022.9.6",start:"2022.9.7",to:"2023.9.6"},
            {from:"2022.10.6",start:"2022.10.7",to:"2023.10.6"},
            {from:"2022.11.6",start:"2022.11.7",to:"2023.11.6"},
            {from:"2022.12.6",start:"2022.12.7",to:"2023.12.6"},
            {from:"2022.1.8",start:"2022.1.9",to:"2023.1.8"},
            {from:"2022.2.8",start:"2022.2.9",to:"2023.2.8"},
            {from:"2022.3.8",start:"2022.3.9",to:"2023.3.8"},
            {from:"2022.4.8",start:"2022.4.9",to:"2023.4.8"},
            {from:"2022.5.8",start:"2022.5.9",to:"2023.5.8"},
            {from:"2022.6.8",start:"2022.6.9",to:"2023.6.8"},
            {from:"2022.7.8",start:"2022.7.9",to:"2023.7.8"},
            {from:"2022.8.8",start:"2022.8.9",to:"2023.8.8"},
            {from:"2022.9.8",start:"2022.9.9",to:"2023.9.8"},
            {from:"2022.10.8",start:"2022.10.9",to:"2023.10.8"},
            {from:"2022.11.8",start:"2022.11.9",to:"2023.11.8"},
            {from:"2022.12.8",start:"2022.12.9",to:"2023.12.8"},
            {from:"2020.1.16",start:"2020.1.17",to:"2021.1.16"},
            {from:"2020.1.17",start:"2020.1.18",to:"2021.1.17"},
            {from:"2020.1.18",start:"2020.1.19",to:"2021.1.18"},
            {from:"2020.1.19",start:"2020.1.20",to:"2021.1.19"},
            {from:"2020.1.20",start:"2020.1.21",to:"2021.1.20"},
            {from:"2020.1.21",start:"2020.1.22",to:"2021.1.21"},
            {from:"2020.1.22",start:"2020.1.23",to:"2021.1.22"},
            {from:"2020.1.23",start:"2020.1.24",to:"2021.1.23"},
            {from:"2020.1.24",start:"2020.1.25",to:"2021.1.24"},
            {from:"2020.1.25",start:"2020.1.26",to:"2021.1.25"},
            {from:"2020.1.26",start:"2020.1.27",to:"2021.1.26"},
            {from:"2020.1.27",start:"2020.1.28",to:"2021.1.27"},
            {from:"2020.1.28",start:"2020.1.29",to:"2021.1.28"},
            {from:"2020.1.29",start:"2020.1.30",to:"2021.1.29"},
            {from:"2020.2.16",start:"2020.2.17",to:"2021.2.16"},
            {from:"2020.2.17",start:"2020.2.18",to:"2021.2.17"},
            {from:"2020.2.18",start:"2020.2.19",to:"2021.2.18"},
            {from:"2020.2.19",start:"2020.2.20",to:"2021.2.19"},
            {from:"2020.2.20",start:"2020.2.21",to:"2021.2.20"},
            {from:"2020.2.21",start:"2020.2.22",to:"2021.2.21"},
            {from:"2020.2.22",start:"2020.2.23",to:"2021.2.22"},
            {from:"2020.2.23",start:"2020.2.24",to:"2021.2.23"},
            {from:"2020.2.24",start:"2020.2.25",to:"2021.2.24"},
            {from:"2020.2.25",start:"2020.2.26",to:"2021.2.25"},
            {from:"2020.2.26",start:"2020.2.27",to:"2021.2.26"},
            {from:"2020.2.27",start:"2020.2.28",to:"2021.2.27"},
            {from:"2020.2.28",start:"2020.2.29",to:"2021.2.28"},
            {from:"2020.2.29",start:"2020.2.30",to:"2021.2.29"},
            {from:"2020.3.16",start:"2020.3.17",to:"2021.3.16"},
            {from:"2020.3.17",start:"2020.3.18",to:"2021.3.17"},
            {from:"2020.3.18",start:"2020.3.19",to:"2021.3.18"},
            {from:"2020.3.19",start:"2020.3.20",to:"2021.3.19"},
            {from:"2020.3.20",start:"2020.3.21",to:"2021.3.20"},
            {from:"2020.3.21",start:"2020.3.22",to:"2021.3.21"},
            {from:"2020.3.22",start:"2020.3.23",to:"2021.3.22"},
            {from:"2020.3.23",start:"2020.3.24",to:"2021.3.23"},
            {from:"2020.3.24",start:"2020.3.25",to:"2021.3.24"},
            {from:"2020.3.25",start:"2020.3.26",to:"2021.3.25"},
            {from:"2020.3.26",start:"2020.3.27",to:"2021.3.26"},
            {from:"2020.3.27",start:"2020.3.28",to:"2021.3.27"},
            {from:"2020.3.28",start:"2020.3.29",to:"2021.3.28"},
            {from:"2020.3.29",start:"2020.3.30",to:"2021.3.29"},
            {from:"2020.4.16",start:"2020.4.17",to:"2021.4.16"},
            {from:"2020.4.17",start:"2020.4.18",to:"2021.4.17"},
            {from:"2020.4.18",start:"2020.4.19",to:"2021.4.18"},
            {from:"2020.4.19",start:"2020.4.20",to:"2021.4.19"},
            {from:"2020.4.20",start:"2020.4.21",to:"2021.4.20"},
            {from:"2020.4.21",start:"2020.4.22",to:"2021.4.21"},
            {from:"2020.4.22",start:"2020.4.23",to:"2021.4.22"},
            {from:"2020.4.23",start:"2020.4.24",to:"2021.4.23"},
            {from:"2020.4.24",start:"2020.4.25",to:"2021.4.24"},
            {from:"2020.4.25",start:"2020.4.26",to:"2021.4.25"},
            {from:"2020.4.26",start:"2020.4.27",to:"2021.4.26"},
            {from:"2020.4.27",start:"2020.4.28",to:"2021.4.27"},
            {from:"2020.4.28",start:"2020.4.29",to:"2021.4.28"},
            {from:"2020.4.29",start:"2020.4.30",to:"2021.4.29"},
            {from:"2020.5.16",start:"2020.5.17",to:"2021.5.16"},
            {from:"2020.5.17",start:"2020.5.18",to:"2021.5.17"},
            {from:"2020.5.18",start:"2020.5.19",to:"2021.5.18"},
            {from:"2020.5.19",start:"2020.5.20",to:"2021.5.19"},
            {from:"2020.5.20",start:"2020.5.21",to:"2021.5.20"},
            {from:"2020.5.21",start:"2020.5.22",to:"2021.5.21"},
            {from:"2020.5.22",start:"2020.5.23",to:"2021.5.22"},
            {from:"2020.5.23",start:"2020.5.24",to:"2021.5.23"},
            {from:"2020.5.24",start:"2020.5.25",to:"2021.5.24"},
            {from:"2020.5.25",start:"2020.5.26",to:"2021.5.25"},
            {from:"2020.5.26",start:"2020.5.27",to:"2021.5.26"},
            {from:"2020.5.27",start:"2020.5.28",to:"2021.5.27"},
            {from:"2020.5.28",start:"2020.5.29",to:"2021.5.28"},
            {from:"2020.5.29",start:"2020.5.30",to:"2021.5.29"},
            {from:"2020.6.16",start:"2020.6.17",to:"2021.6.16"},
            {from:"2020.6.17",start:"2020.6.18",to:"2021.6.17"},
            {from:"2020.6.18",start:"2020.6.19",to:"2021.6.18"},
            {from:"2020.6.19",start:"2020.6.20",to:"2021.6.19"},
            {from:"2020.6.20",start:"2020.6.21",to:"2021.6.20"},
            {from:"2020.6.21",start:"2020.6.22",to:"2021.6.21"},
            {from:"2020.6.22",start:"2020.6.23",to:"2021.6.22"},
            {from:"2020.6.23",start:"2020.6.24",to:"2021.6.23"},
            {from:"2020.6.24",start:"2020.6.25",to:"2021.6.24"},
            {from:"2020.6.25",start:"2020.6.26",to:"2021.6.25"},
            {from:"2020.6.26",start:"2020.6.27",to:"2021.6.26"},
            {from:"2020.6.27",start:"2020.6.28",to:"2021.6.27"},
            {from:"2020.6.28",start:"2020.6.29",to:"2021.6.28"},
            {from:"2020.6.29",start:"2020.6.30",to:"2021.6.29"},
            {from:"2020.7.16",start:"2020.7.17",to:"2021.7.16"},
            {from:"2020.7.17",start:"2020.7.18",to:"2021.7.17"},
            {from:"2020.7.18",start:"2020.7.19",to:"2021.7.18"},
            {from:"2020.7.19",start:"2020.7.20",to:"2021.7.19"},
            {from:"2020.7.20",start:"2020.7.21",to:"2021.7.20"},
            {from:"2020.7.21",start:"2020.7.22",to:"2021.7.21"},
            {from:"2020.7.22",start:"2020.7.23",to:"2021.7.22"},
            {from:"2020.7.23",start:"2020.7.24",to:"2021.7.23"},
            {from:"2020.7.24",start:"2020.7.25",to:"2021.7.24"},
            {from:"2020.7.25",start:"2020.7.26",to:"2021.7.25"},
            {from:"2020.7.26",start:"2020.7.27",to:"2021.7.26"},
            {from:"2020.7.27",start:"2020.7.28",to:"2021.7.27"},
            {from:"2020.7.28",start:"2020.7.29",to:"2021.7.28"},
            {from:"2020.7.29",start:"2020.7.30",to:"2021.7.29"},
            {from:"2020.8.16",start:"2020.8.17",to:"2021.8.16"},
            {from:"2020.8.17",start:"2020.8.18",to:"2021.8.17"},
            {from:"2020.8.18",start:"2020.8.19",to:"2021.8.18"},
            {from:"2020.8.19",start:"2020.8.20",to:"2021.8.19"},
            {from:"2020.8.20",start:"2020.8.21",to:"2021.8.20"},
            {from:"2020.8.21",start:"2020.8.22",to:"2021.8.21"},
            {from:"2020.8.22",start:"2020.8.23",to:"2021.8.22"},
            {from:"2020.8.23",start:"2020.8.24",to:"2021.8.23"},
            {from:"2020.8.24",start:"2020.8.25",to:"2021.8.24"},
            {from:"2020.8.25",start:"2020.8.26",to:"2021.8.25"},
            {from:"2020.8.26",start:"2020.8.27",to:"2021.8.26"},
            {from:"2020.8.27",start:"2020.8.28",to:"2021.8.27"},
            {from:"2020.8.28",start:"2020.8.29",to:"2021.8.28"},
            {from:"2020.8.29",start:"2020.8.30",to:"2021.8.29"},
            {from:"2020.9.16",start:"2020.9.17",to:"2021.9.16"},
            {from:"2020.9.17",start:"2020.9.18",to:"2021.9.17"},
            {from:"2020.9.18",start:"2020.9.19",to:"2021.9.18"},
            {from:"2020.9.19",start:"2020.9.20",to:"2021.9.19"},
            {from:"2020.9.20",start:"2020.9.21",to:"2021.9.20"},
            {from:"2020.9.21",start:"2020.9.22",to:"2021.9.21"},
            {from:"2020.9.22",start:"2020.9.23",to:"2021.9.22"},
            {from:"2020.9.23",start:"2020.9.24",to:"2021.9.23"},
            {from:"2020.9.24",start:"2020.9.25",to:"2021.9.24"},
            {from:"2020.9.25",start:"2020.9.26",to:"2021.9.25"},
            {from:"2020.9.26",start:"2020.9.27",to:"2021.9.26"},
            {from:"2020.9.27",start:"2020.9.28",to:"2021.9.27"},
            {from:"2020.9.28",start:"2020.9.29",to:"2021.9.28"},
            {from:"2020.9.29",start:"2020.9.30",to:"2021.9.29"},
            {from:"2020.10.16",start:"2020.10.17",to:"2021.10.16"},
            {from:"2020.10.17",start:"2020.10.18",to:"2021.10.17"},
            {from:"2020.10.18",start:"2020.10.19",to:"2021.10.18"},
            {from:"2020.10.19",start:"2020.10.20",to:"2021.10.19"},
            {from:"2020.10.20",start:"2020.10.21",to:"2021.10.20"},
            {from:"2020.10.21",start:"2020.10.22",to:"2021.10.21"},
            {from:"2020.10.22",start:"2020.10.23",to:"2021.10.22"},
            {from:"2020.10.23",start:"2020.10.24",to:"2021.10.23"},
            {from:"2020.10.24",start:"2020.10.25",to:"2021.10.24"},
            {from:"2020.10.25",start:"2020.10.26",to:"2021.10.25"},
            {from:"2020.10.26",start:"2020.10.27",to:"2021.10.26"},
            {from:"2020.10.27",start:"2020.10.28",to:"2021.10.27"},
            {from:"2020.10.28",start:"2020.10.29",to:"2021.10.28"},
            {from:"2020.10.29",start:"2020.10.30",to:"2021.10.29"},
            {from:"2020.11.16",start:"2020.11.17",to:"2021.11.16"},
            {from:"2020.11.17",start:"2020.11.18",to:"2021.11.17"},
            {from:"2020.11.18",start:"2020.11.19",to:"2021.11.18"},
            {from:"2020.11.19",start:"2020.11.20",to:"2021.11.19"},
            {from:"2020.11.20",start:"2020.11.21",to:"2021.11.20"},
            {from:"2020.11.21",start:"2020.11.22",to:"2021.11.21"},
            {from:"2020.11.22",start:"2020.11.23",to:"2021.11.22"},
            {from:"2020.11.23",start:"2020.11.24",to:"2021.11.23"},
            {from:"2020.11.24",start:"2020.11.25",to:"2021.11.24"},
            {from:"2020.11.25",start:"2020.11.26",to:"2021.11.25"},
            {from:"2020.11.26",start:"2020.11.27",to:"2021.11.26"},
            {from:"2020.11.27",start:"2020.11.28",to:"2021.11.27"},
            {from:"2020.11.28",start:"2020.11.29",to:"2021.11.28"},
            {from:"2020.11.29",start:"2020.11.30",to:"2021.11.29"},
            {from:"2020.12.16",start:"2020.12.17",to:"2021.12.16"},
            {from:"2020.12.17",start:"2020.12.18",to:"2021.12.17"},
            {from:"2020.12.18",start:"2020.12.19",to:"2021.12.18"},
            {from:"2020.12.19",start:"2020.12.20",to:"2021.12.19"},
            {from:"2020.12.20",start:"2020.12.21",to:"2021.12.20"},
            {from:"2020.12.21",start:"2020.12.22",to:"2021.12.21"},
            {from:"2020.12.22",start:"2020.12.23",to:"2021.12.22"},
            {from:"2020.12.23",start:"2020.12.24",to:"2021.12.23"},
            {from:"2020.12.24",start:"2020.12.25",to:"2021.12.24"},
            {from:"2020.12.25",start:"2020.12.26",to:"2021.12.25"},
            {from:"2020.12.26",start:"2020.12.27",to:"2021.12.26"},
            {from:"2020.12.27",start:"2020.12.28",to:"2021.12.27"},
            {from:"2020.12.28",start:"2020.12.29",to:"2021.12.28"},
            {from:"2020.12.29",start:"2020.12.30",to:"2021.12.29"},
        ]
    },

    getInfo(){
        let num = Math.floor(Math.random() * (220) )
        let je = Math.floor(Math.random()*(250-160))+160
        let that = this
        let aname = app.globalData.anm_name
        let anum = app.globalData.anum
       
        wx.cloud.database().collection('jd').where({
            a1:app.globalData.a1,
            a2:app.globalData.a2,
            a3:app.globalData.a3,
            a4:app.globalData.a4
        }).get({success(res){
            console.log(res)
                if(res.data.length!=0){
                    that.setData({
                        aname:res.data[0].a1,
                        anum:res.data[0].num,
                        from:res.data[0].from,
                        start:res.data[0].start,
                        to:res.data[0].to,
                        je:res.data[0].je,
                        anmimgPath:res.data[0].imgurl,
                        company:"畜牧保"
                    })
                }else{
                    that.setData({
                        from:"未投保",
                        start:"未投保",
                        to:"未投保",
                        je:0,
                        aname: aname,
                        anum: "未投保",
                        company:"未投保"
                    })
                }
        }})
    },

    toback() {
        wx.navigateBack({
          delta: 0,
          success: (res) => {},
          fail: (res) => {},
          complete: (res) => {},
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.setData({
            anmimgPath : app.globalData.anmimgPath
        })
        this.getInfo()
    },

})